/*
 * Academic License - for use in teaching, academic research, and meeting
 * course requirements at degree granting institutions only.  Not for
 * government, commercial, or other organizational use.
 * File: nanmean.c
 *
 * MATLAB Coder version            : 3.4
 * C/C++ source code generated on  : 31-Oct-2022 18:36:01
 */

/* Include Files */
#include "rt_nonfinite.h"
#include "autobase.h"
#include "nanmean.h"

/* Function Definitions */

/*
 * Arguments    : const float varargin_1[24]
 * Return Type  : float
 */
float b_nanmean(const float varargin_1[24])
{
  float y;
  int c;
  int k;
  y = 0.0F;
  c = 0;
  for (k = 0; k < 24; k++) {
    if (!rtIsNaNF(varargin_1[k])) {
      y += varargin_1[k];
      c++;
    }
  }

  if (c == 0) {
    y = ((real32_T)rtNaN);
  } else {
    y /= (float)c;
  }

  return y;
}

/*
 * Arguments    : const float varargin_1[216]
 * Return Type  : float
 */
float c_nanmean(const float varargin_1[216])
{
  float y;
  int c;
  int k;
  y = 0.0F;
  c = 0;
  for (k = 0; k < 216; k++) {
    if (!rtIsNaNF(varargin_1[k])) {
      y += varargin_1[k];
      c++;
    }
  }

  if (c == 0) {
    y = ((real32_T)rtNaN);
  } else {
    y /= (float)c;
  }

  return y;
}

/*
 * Arguments    : const float varargin_1[173]
 * Return Type  : float
 */
float nanmean(const float varargin_1[173])
{
  float y;
  int c;
  int k;
  y = 0.0F;
  c = 0;
  for (k = 0; k < 173; k++) {
    if (!rtIsNaNF(varargin_1[k])) {
      y += varargin_1[k];
      c++;
    }
  }

  if (c == 0) {
    y = ((real32_T)rtNaN);
  } else {
    y /= (float)c;
  }

  return y;
}

/*
 * File trailer for nanmean.c
 *
 * [EOF]
 */
